package com.nand.blockdemo.adapter;


import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.nand.blockdemo.R;
import com.nand.blockdemo.bean.NewsListBean;


/**
 * Created by 孝杰 on 2019/12/17.
 */
public class NewsAdapter extends BaseQuickAdapter<NewsListBean.NewsLits, BaseViewHolder> {


    public NewsAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, NewsListBean.NewsLits item) {
        helper.setText(R.id.tv_news_title, item.getTitle())
                .setText(R.id.tv_news_time, item.getReleaseDate())
                .setText(R.id.tv_news_subtitle, item.getSubtitle());
        ImageView imageView = helper.getView(R.id.iv_news_image);
        Glide.with(mContext).load(item.getNewsUrl()).into(imageView);
    }
}
